package com.cangxuan.backend.service.impl;

import com.cangxuan.backend.dao.IBannerDao;
import com.cangxuan.backend.entity.Banner;
import com.cangxuan.backend.exception.ServiceException;
import com.cangxuan.backend.service.IBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BannerServiceImpl implements IBannerService {
    IBannerDao bannerDao;

    @Autowired
    public void setBannerDao(IBannerDao bannerDao) {
        this.bannerDao = bannerDao;
    }

    @Override
    public List<String> list() {
        return bannerDao.list();
    }

    // @Override
    // public boolean update(Banner banner) {
    //     int res = bannerDao.update(banner);
    //     if (res <= 0){
    //         throw new ServiceException(400,"操作失败");
    //     }
    //     return true;
    // }
    //
    // @Override
    // public void delete(int id) {
    //     int res = bannerDao.deleteById(id);
    //     if (res<=0){
    //         throw new ServiceException(400,"删除失败");
    //     }
    // }


}
